#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/core/aspnet:2.1-stretch-slim AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/core/sdk:2.1-stretch AS build
WORKDIR /src
COPY ["LJF.ManageSYS/LJF.ManageSYS.csproj", "LJF.ManageSYS/"]
COPY ["Models/LJF.Models.csproj", "Models/"]
COPY ["LJF.Common/LJF.Common.csproj", "LJF.Common/"]
COPY ["LJF.MSSQL/LJF.MSSQL.csproj", "LJF.MSSQL/"]
RUN dotnet restore "LJF.ManageSYS/LJF.ManageSYS.csproj"
COPY . .
WORKDIR "/src/LJF.ManageSYS"
RUN dotnet build "LJF.ManageSYS.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "LJF.ManageSYS.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "LJF.ManageSYS.dll"]